$(() => {
    //看下怎么截取get地址栏里的字符串 location.search  截取用splict()
    // let brandtitleid = location.search.split

    render()

    function render(brandtitleid = 0) {
        $.ajax({
            type: 'get',
            url: 'http://localhost:3000/api/getbrand',
            data: {
                brandtitleid
            },
            dataType: 'json', //text,json,xml,jsonp
            success(res) {
                console.log(res)
                $('.brand-list .category-title').html(template('getbrandTpl', res))
                console.log(location.search);
                console.log(location.search.split('titleid=')[1][0]);
            }
        })

    }
})